SA1D = [1    5   32;
    2   10  250;
    3   17  843;
    4   18  1188;
    5   18  1094;
    6   18  1187 ]

SA1S = [1   8   419;
    2   21  2903;
    3   38  2382;
    4   31  2504;  
    5   40  1904;
    6   46  2304]

SA2D = [1    7   312;
    2   54  23719;
    3   109  124651;
    4   175  391645]

SA2S = [1   14   2302;
    2   134  67047;
    3   1241  9055904]

SA3D = [1    15   2984;
    2   155  1127840]

E = [12 267;
     203  15099;
     Inf Inf];

iter = C(:,1)

node = zeros(size(iter, 1), 5);
node(:,1) = SA1D(:,2);
node(:,2) = SA1S(:,2);
node(:,3) = SA2D(:,2);
node(:,4) = SA2S(:,2);
node(:,5) = SA3D(:,2);


time = zeros(size(iter, 1), 5);
time(:,1) = SA1D(:,3);
time(:,2) = SA1S(:,3);
time(:,3) = SA2D(:,3);
time(:,4) = SA2S(:,3);
time(:,5) = SA3D(:,3);

figure;
hold on;
xlabel('Horizon', 'FontSize', 16);
ylabel('Number of Nodes', 'FontSize', 16);
title('Inventory Control', 'FontSize', 16);
set(gca,'XTick',1:1:6);
% axes('FontSize', 16);
plot(1:6, node(:,1), '--r*');
plot(1:6, node(:,2), ':ro');
plot(1:4, node(:,3), '--g*','linewidth',2);
plot(1:2, node(:,4), ':go');
plot(1:2, node(:,5), '-b#');
plot(1:3, E(:,1), '-.ks');

legend('1 Item, DD', '1 Item, SD','2 Item, DD', '2 Item, SD','3 Item, DD', '1 Item, DD , no pruning', 6);
hold off;


%%

figure;
semilogy(iter,time(:,1), '--r*');
hold on;
semilogy(iter,time(:,2), '-bo');
semilogy(iter,time(:,3), '-bo');
semilogy(iter,time(:,4), '-bo');
semilogy(iter,time(:,5), '-bo');
semilogy(iter(1:3),E(:,2), '-.ks');
xlabel('Horizon', 'FontSize', 16);
ylabel('Time(ms)', 'FontSize', 16);
title('Inventory Control', 'FontSize', 16);
set(gca,'XTick',1:1:6);
legend('1 Item, DD', '1 Item, SD','2 Item, DD', '2 Item, SD','3 Item, DD', '1 Item, DD , no pruning', 6);
hold off;